<template>
<div class="guahao03">
  <div class="header">预约挂号</div>

  <div class="search">
    <div class="searcher">
      <i class="iconfont icon-sousuo"></i>
      <span class="span">搜索医院，医生，科室，疾病</span>
    </div>
  </div>

  <div class="list">
    <div class="left">
      <div class="classification focus"><i class="iconfont icon-yousanjiao"></i>内科</div>
      <div v-for="(d,idx) in dataer" class="classification">{{d.dName}}</div>
    </div>
    <div class="right">
      <div v-for="(b,index) in dataer[0].dBrach" class="department" @click="goGuahao04(hNum)">心血管内科</div>
    </div>
  </div>
</div>
</template>

<script>
    export default {
        name: 'guahao03',
        data() {
            return {
              dataer:null,
              hNum:null
            }
        },
        methods:{
          goGuahao04:function (hNum) {
            this.$router.push(`/guahao04/${hNum}`)
          }
        },
      created:function(){
        let idx= this.$route.params.hNum
        this.hNum=idx
        this.$store.dispatch('getdata')
        this.dataer=this.$store.state.data.hospital[idx].hDepartment
        console.log(this.dataer)
      }
    }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
@import "../assets/css/guahao03.css";
</style>
